home *** CD-ROM | disk | FTP | other *** search
- Path: news1.ucsd.edu!usenet
- From: djohnson@tartarus.ucsd.edu (Darin Johnson)
- Newsgroups: comp.edu,comp.lang.c,comp.lang.c++
- Subject: Re: C or C++ for a 14-year old?
- Date: 08 Jan 1996 16:33:02 -0800
- Organization: UCSD Computer Science and Engineering Department
- Sender: djohnson@tartarus.ucsd.edu
- Message-ID: <qq4tu6nr5t.fsf@tartarus.ucsd.edu>
- References: <4b30ld$lp2$1@mhafc.production.compuserve.com>
- <w31V7MD4ED1aLz3@dexam.another.gun.de>
- <dschrage.23.152EBB70@indirect.com>
- <4cq6cr$t51@dub-news-svc-1.compuserve.com> <4cqhu3$1quo@news.gate.net>
- NNTP-Posting-Host: tartarus.ucsd.edu
- In-reply-to: bhutto@gate.net's message of 8 Jan 1996 07:42:59 GMT
- X-Newsreader: Gnus v5.0
-
- bhutto@gate.net (William Hutto) writes:
- > 10 FOR I=1 TO 10
- > 20 PRINT "YOUR NAME HERE"
- > 30 NEXT I
- > 40 END
- >
- > RUN
-
- That's much of the problem with BASIC. More modern BASIC's are
- better than this, why go back to the 70's way of doing things?
- You don't need a label on every line. It just makes things
- harder (renumber is a kluge to get around a bad feature).
-
- What about
-
- For I=1 to 10
- print "your name here"
- next i
- end
-
- With no labels. Or better yet, forget the wierd for statment
- (that was very hard for me to grasp when I first saw it, because
- first I kept trying to fit the English meaning of the words into
- place, and second, it wasn't explained that this was just a shortcut
- for a while statement)
-
- Personally, I think it's just as easy for a beginner to understand
-
- i = 1
- while i <= 10
- print "your name here"
- done
-
- Not only is it easy to understand, you start to see statements in
- terms of groups of statements, not a sequential list. You start
- to see programs as a hierarchical structure, not a flowchart.
- And when you get to BASIC programs of over 50 lines, things get
- ugly *fast*. Why should the beginner struggle deciphering a few
- pages of BASIC code, when they could breeze through the same amount
- if it were written in a Pascal like language?
-
- [C program removed]
- > This *program* requires considerably more explanation. Also, if this
- > is not a C *interpreter* the student needs to know something about compilation
- > and may even need to know about files and linking.
-
- Yes, C isn't so great for the beginner. Elementary Pascal programs
- aren't so bad. There's a little preamble, but simpler than C, and
- far fewer "just do it that way, I'll explain later".
-
- > The ultimate *destination* might be a commonly used/accepted language.
- > I went from BASIC to 6502 assembly language, 8086 assembly language, C, C++
- > and then Pascal. When I got to Pascal I thought, "Oops, wrong way!"
- > I almost wanted to say, start with assembler.
-
- First thing I did was Cardiac - a cardboard instructional aid to
- computers (yeah right, no one had computers back then, at least no in
- hick towns). Then something that had relays and such, looking a lot
- like a sturdy version of the radioshack electronics kits. Then I got
- access to a real computer, and did a bit of assembler. Then I looked
- over at the TSR machine next to the Altair and said, hey, that's a lot
- simpler, and I don't have to punch in a bunch of bootup code either
- :-) Then I did a bunch of basic, hurting my head trying to decipher
- the long programs.
-
- Then I saw Pascal in college, and for the first time, I related
- programs to math, and things were elegant, not a jumble of code.
- Things were abstract, not tied to the nuts and bolts of the machine.
- It was just so vastly different from the way I had looked at things
- before. You could actually write huge programs and be able to
- understand it for once. So maybe, there's still a little bit of me
- that thinks the beginner should do things the hard way, just to get a
- better appreciation of high level languages (and then I wise up and
- realize that the lesson would be lost on 90% of the them).
- --
- Darin Johnson
- djohnson@ucsd.edu -- Strange things are afoot at the circle-K...
-